package org.foxas.classarray
{
	import org.foxas.base.FFunc;
	
	public class ClassArray
	{
		public var arr:Array = new Array();
		public function ClassArray(_numwElements:int=0)
		{
			arr = new Array(_numwElements);
		}
		//=======extend
		public function clear():void{
			arr.splice(0,arr.length);
		}
		//override
		public function getChildAt(_i:int):Object{
			return arr[_i];
		}
		public function get length():int{
			return arr.length;
		}
		public function a(_i:int,_item:Object):void{
			arr[_i] = _item;
		}
		public function indexOf(_searchElement:Object,_fromIndex:int=0):int{
			return arr.indexOf(_searchElement,_fromIndex);
		}
		public function lastIndexOf(_searchElement:Object,_fromIndex:int=0x7fffffff):int{
			return arr.lastIndexOf(_searchElement,_fromIndex);
		}
		public function push(_arg:Object):void{
			if(_arg==null){
				throw new Error("alarm: ClassArray.push _arg==null");
			}else{
				arr[arr.length] = _arg;
			}
//			return arr.push(args);
		}
		public function unshift(...args):uint{
			return arr.unshift(args);
		}
		public function pop():Object{
			return arr.pop();
		}
		public function shift():Object{
			return arr.shift();
		}
		public function splice(_startIndex:int,_deleteCount:int=1):void{
			arr.splice(_startIndex,_deleteCount);
		}
		public function slice(_startIndex:int=0,_endIndex:int=0):void{
			this.arr.slice(_startIndex,_endIndex);
		}
	}
}